package com.example.administrator.base.activity;

import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

import com.allenliu.versionchecklib.core.VersionDialogActivity;
import com.example.administrator.base.R;
import com.example.administrator.base.util.SharedPreferencesUtils;
import com.example.administrator.base.view.BaseDialog;

public class View extends VersionDialogActivity {
    private BaseDialog baseDialog;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view);

    }

    @Override
    public void showVersionDialog() {
        customVersionDialogTwo();
    }

    private void customVersionDialogTwo() {
        baseDialog = new BaseDialog(this, R.style.BaseDialog, R.layout.custom_dialog_two);
        TextView textView=(TextView)baseDialog.findViewById(R.id.tv2);
        String mse= String.valueOf(SharedPreferencesUtils.getParam(View.this,"uodatames",""));
        String s = mse.replaceAll("-", "\n");
        textView.setText(getString(R.string.updatamessage,s));
        Button tvUpdate = (Button) baseDialog.findViewById(R.id.tv_update);
        tvUpdate.setOnClickListener(new android.view.View.OnClickListener() {
           @Override
           public void onClick(android.view.View v) {
               baseDialog.dismiss();
               downloadFile();
           }
       });
        baseDialog.show();
    }
}
